home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 28
/
Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso
/
Aminet
/
dev
/
gui
/
gui4cli.lha
/
Gui4Cli
/
Gui4Cli.gc
< prev
next >
Wrap
Text File
|
1998-10-22
|
12KB
|
525 lines
G4C
; $VER: Gui4Cli.gc 3.5
; =================================================================
; This is the gui which is opened when you click the "Prefs" button
; on the Gui4Cli requester.
; If you find yourself feeling queezy after having suffered the full
; effect of it's poping open at you unwarned, you may change it as
; you see fit..
WINBIG 179 24 299 201 "Gui4Cli"
WinType 11110001
BOX 0 0 297 201 out button
;* ICON 244 11 "guis:gui4cli"
; -----------------------------------------------------------------
; System events
; -----------------------------------------------------------------
xOnLoad
setgadvalues gui4cli.gc ; set default values
setgad gui4cli.gc 72 off
mode = GUI
lvhelp = 'Choose guis to load'
oldguidir = GUIs:
update gui4cli.gc 50 'Port: $$g4c.port'
gosub gui4cli.gc guichange
guiopen Gui4Cli.gc
xonreload
guiopen Gui4Cli.gc
guiscreen gui4cli.gc front
xOnOpen
SetGad Gui4Cli.gc 1 OFF ; remove the appicon
if $mode = LOAD ; refresh stuff..
lvuse Gui4Cli.gc 10
lvdir refresh
elseif $mode = GUI
lvuse Gui4Cli.gc 54
lvdir #env:$$g4c.port
endif
xOnClose
SetGad Gui4Cli.gc 1 ON ; open the appicon
xOnFail
ezreq "Failed.." OK ""
xAppIcon 0 0 GUIs:Gui4Cli "Gui4Cli" apivar OFF
GadID 1
GuiOpen Gui4Cli.gc
GuiScreen Gui4Cli.gc FRONT
if $apivar > ' '
andifexists DIRECTORY $apivar ; if a directory or volume icon was
orifexists DOS $apivar ; dropped on the icon,
lvuse Gui4Cli.gc 10 ; we cd to it..
lvdir #$apivar
endif
; -----------------------------------------------------------------
; Main mode CYCLER
; - will rotate gui through all modes
; -----------------------------------------------------------------
XCYCLER 6 4 120 15 '' mode
gadid 900
gadhelp 'Will cycle the gui through its modes'
cstr 'GUI Control' GUI
cstr 'GUI Load' LOAD
cstr 'Settings' SET
gosub gui4cli.gc guichange
xroutine guichange
docase $mode
case = GUI
setgad gui4cli.gc 10 HIDE ; the listview
setgad gui4cli.gc 50/59 SHOW ; other lv & Open/close/quit etc
setgad gui4cli.gc 60/100 HIDE
lvuse Gui4Cli.gc 54
lvdir #env:$$g4c.port
setwintitle gui4cli.gc 'Port $$g4c.port : Home '
break
case = LOAD
setgad gui4cli.gc 10 SHOW
setgad gui4cli.gc 50/58 HIDE
setgad gui4cli.gc 59 SHOW
setgad gui4cli.gc 60/79 SHOW
setgad gui4cli.gc 80/100 HIDE
lvhelp = 'Choose guis from here'
setwintitle gui4cli.gc '$oldguidir '
break
case = SET
setgad gui4cli.gc 10 HIDE
setgad gui4cli.gc 50/79 HIDE
setgad gui4cli.gc 80/89 SHOW
setwintitle gui4cli.gc 'Gui4Cli settings'
break
endcase
partredraw gui4cli.gc 4 20 291 178
; -----------------------------------------------------------------
; Listview for GUI mode
; -----------------------------------------------------------------
XLISTVIEW 6 66 285 132 "" guivar '' 0 DIR
gadid 54
gadfont #mono 8 000
gadhelp 'These are the guis currently loaded'
extract guivar file fname
guiopen $fname
; -----------------------------------------------------------------
; GUI mode
; will act on the selected listview items
; -----------------------------------------------------------------
TEXT 105 25 174 15 port 35 BOX
gadid 50
XBUTTON 15 45 20 14 "R" ; refresh list
gadid 51
gadhelp 'Refreshes the list of loaded guis'
lvuse Gui4Cli.gc 54
lvdir refresh
XBUTTON 40 45 58 14 Open ; open
gadid 51
gadhelp 'Will open the selected guis'
lvuse Gui4Cli.gc 54
lvmulti first
while $guivar > ''
extract guivar file fname
guiopen $fname
lvmulti next
endwhile
lvdir none
XBUTTON 100 45 58 14 Close ; close
gadid 52
gadhelp 'Will close the selected guis'
lvuse Gui4Cli.gc 54
lvmulti first
while $guivar > ''
extract guivar file fname
guiclose $fname
lvmulti next
endwhile
lvdir none
XBUTTON 160 45 58 14 Unload ; unload
gadid 53
gadhelp 'Will quit the selected guis'
lvuse Gui4Cli.gc 54
lvmulti first
while $guivar > ''
extract guivar file fname
guiquit $fname
lvmulti next
endwhile
; the guis won't actually quit until all commands have executed, so..
reflag = 1
xAfter
if $reflag = 1
reflag = 0
lvdir refresh
endif
XBUTTON 235 45 20 14 "A" ; also shown in gui mode
gadhelp 'Select all items'
gadid 51
lvuse Gui4Cli.gc 54
lvdir all
XBUTTON 255 45 20 14 "N"
gadhelp 'Unselect all items'
gadid 51
lvuse Gui4Cli.gc 54
lvdir none
BOX 6 22 284 41 in button
GADID 59
CTEXT 18 27 'GUI Control' #screen 8 2 0 0001
gadid 50
; -----------------------------------------------------------------
; Listview for LOAD/FAV mode
; -----------------------------------------------------------------
XLISTVIEW 6 66 285 132 "" guivar GUIs: 0 DIR
gadid 10
gadfont #mono 8 000
gadhelp 'Listview : $lvhelp' ; we set it above according to mode
docase $mode
case = FAV
setgad gui4cli.gc 71 on ; if double clicked in FAV mode
setgad gui4cli.gc 60/63 on ; set it back to LOAD mode
setgad gui4cli.gc 72 off ; and cd to selection
lvhelp = 'Choose guis to load'
lvmode DIR
lvdir #$guivar
mode = LOAD
break
case = LOAD
if $guivar H= G4C
guiload $guivar
endif
break
endcase
xlvdirhook 10
if $mode = LOAD
oldguidir = $$lv.dir
setwintitle gui4cli.gc '$oldguidir '
endif
; -----------------------------------------------------------------
; Load mode
; -----------------------------------------------------------------
; for the box use the same as above (gadid 59)
CTEXT 20 27 GuiLoad #screen 8 2 0 0001
gadid 60
XBUTTON 24 42 80 14 Load ; load
gadhelp 'Will load the selected files if they are guis'
gadid 60
lvuse Gui4Cli.gc 10
lvmulti first
while $guivar > ''
if $guivar H= G4C
guiload $guivar
endif
lvmulti next
endwhile
lvdir none
XBUTTON 117 42 20 14 "P"
gadhelp 'CD to Parent dir'
gadid 60
lvuse Gui4Cli.gc 10
lvdir parent
oldguidir = $$lv.dir
setwintitle gui4cli.gc '$oldguidir '
XBUTTON 138 42 20 14 "D"
gadhelp 'Show Volumes list'
gadid 60
lvuse Gui4Cli.gc 10
lvdir disks
oldguidir = ''
setwintitle gui4cli.gc 'Devices'
XBUTTON 171 42 20 14 "G"
gadhelp 'Shortcut to GUIs:'
gadid 60
lvuse Gui4Cli.gc 10
lvdir #Guis:
oldguidir = GUIs:
setwintitle gui4cli.gc 'GUIs:'
XBUTTON 117 27 20 14 "A" ; also shown in gui mode
gadhelp 'Select all items'
gadid 60
lvuse Gui4Cli.gc 10
lvdir all
XBUTTON 138 27 20 14 "N"
gadhelp 'Unselect all items'
gadid 60
lvuse Gui4Cli.gc 10
lvdir none
; -----------------------------------------------------------------
; Favourites control
; -----------------------------------------------------------------
XBUTTON 192 27 58 14 "Fav"
gadid 70
gadhelp 'Switches to and from Favourites mode'
lvuse gui4cli.gc 10
if $mode = FAV
setgad gui4cli.gc 71 on
setgad gui4cli.gc 60/63 on
setgad gui4cli.gc 72 off
lvhelp = 'Choose guis to load'
lvmode DIR
lvdir #$oldguidir
mode = LOAD
else
setgad gui4cli.gc 71 off
setgad gui4cli.gc 60/63 off
setgad gui4cli.gc 72 on
lvhelp = 'Double click on a directory, or hit FAV again to cancel'
lvmode MULTI
lvchange guis:tools/fav/G4C.fav
lvsort asc
mode = FAV
endif
XBUTTON 252 27 29 14 "+"
gadid 71
gadhelp 'Adds the current dir the Listview is at, to your favourites'
lvuse gui4cli.gc 10
append guis:tools/fav/g4c.fav '\n$$lv.dir'
XBUTTON 252 42 29 14 "-"
gadid 72
gadhelp 'Deletes selected favourite entries'
lvuse gui4cli.gc 10
lvmulti first
while $guivar > ''
lvdel -1
lvmulti first
endwhile
XBUTTON 192 42 58 14 "Save"
gadid 72
gadhelp 'Save favourites to GUIs:tools/fav/G4C.fav'
lvuse gui4cli.gc 10
lvsave guis:tools/fav/g4c.fav
; -----------------------------------------------------------------
; Gui4Cli Settings
; -----------------------------------------------------------------
BOX 10 90 276 41 in button
gadid 80
CTEXT 20 27 'Settings